package com.example.administrator.managesystem.video;

import android.view.View;

import com.example.administrator.managesystem.R;
import com.example.administrator.managesystem.adapter.CameraListAdapter;
import com.example.administrator.managesystem.adapter.holder.CameraHolder;
import com.example.administrator.managesystem.base.BaseActivity;
import com.example.administrator.managesystem.base.BaseHelper;
import com.example.administrator.managesystem.bean.CameraListBean;
import com.example.administrator.managesystem.bean.WikiDetailBean;
import com.example.administrator.managesystem.utils.ToastUtils;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

import java.util.ArrayList;
import java.util.List;

import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;

public class CameraListActivity extends BaseActivity {
    private List<CameraListBean.DataBean> camera_list=new ArrayList<>();
    private CameraListAdapter cameraListAdapter;
    private XRecyclerView xRecyclerView;
    private String url,device_number;
    private StandardGSYVideoPlayer jcVideoPlayerStandard;
    @Override
    public void initView() {
     showfloatButton(true,true);

    }

    @Override
    public void doBusiness() {
       url=getIntent().getStringExtra("url");
       device_number=getIntent().getStringExtra("device_number");
        jcVideoPlayerStandard= findViewById(R.id.detail_player);
        jcVideoPlayerStandard.setUpLazy(url, true, null, null, "这是title");
     //   jcVideoPlayerStandard.setUp(url,JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL);



    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_camera_list;
    }


    @Override
    protected void onPause() {
        super.onPause();
        JCVideoPlayerStandard.releaseAllVideos();
    }

    @Override
    public void onBackPressed() {
        if (JCVideoPlayer.backPress()){
            return;
        }
        super.onBackPressed();
    }

//    @Override
//    public void onDestroy() {
//        //activity销毁的时候释放资源，播放器停止播放"
//        super.onDestroy();
//        try {
//            jcVideoPlayerStandard.releaseAllVideos();
//        } catch (Exception e) {
//        }
//    }
}
